Broken STLport support in NDKr6?

562 views
Skip to first unread message

barainvienna

unread,
Aug 23, 2011, 5:16:16 PM8/23/11
to android-ndk
Hi,

I try to build an NDKr6-based project on Win7 using "APP_STL :=
stlport_static" in Application.mk.
When I run ndk-build, I get the following error:

Android NDK: WARNING: Rebuilding STLport libraries from sources!
Android NDK: You might want to use $NDK/build/tools/build-
stlport.sh
Android NDK: in order to build prebuilt versions to speed up your
builds!

Although I haven't specified "STLPORT_FORCE_REBUILD := true" anywhere,
the project builds "libstlport_static.a" from scratch. The the app
works fine, however, the build takes significantly lower.

When I try to build (as suggested by the warning) the STLport libs
using the given "build-stlport.sh", it fails with errors saying that
some source files are missing although they are there:

$ ./build-stlport.sh
arm-linux-androideabi-g++.exe: /cygdrive/c/dev/Android/android-ndk-r6/
sources/cxx-stl/stlport/src/dll_main.cpp: No such file or directory
arm-linux-androideabi-g++.exe: no input files
arm-linux-androideabi-g++.exe: /cygdrive/c/dev/Android/android-ndk-r6/
sources/cxx-stl/stlport/src/fstream.cpp: No such file or directory
arm-linux-androideabi-g++.exe: no input files
make: *** [/tmp/ndk-istvanb/tmp/build-6668/build-stlport/armeabi/
dll_main.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/tmp/ndk-istvanb/tmp/build-6668/build-stlport/armeabi/
fstream.o] Error 1
arm-linux-androideabi-g++.exe: /cygdrive/c/dev/Android/android-ndk-r6/
sources/cxx-stl/stlport/src/strstream.cpp: No such file or directory
arm-linux-androideabi-g++.exe: no input files
make: *** [/tmp/ndk-istvanb/tmp/build-6668/build-stlport/armeabi/
strstream.o] Error 1
arm-linux-androideabi-g++.exe: /cygdrive/c/dev/Android/android-ndk-r6/
sources/cxx-stl/stlport/src/sstream.cpp: No such file or directory
arm-linux-androideabi-g++.exe: no input files
make: *** [/tmp/ndk-istvanb/tmp/build-6668/build-stlport/armeabi/
sstream.o] Error 1
arm-linux-androideabi-g++.exe: /cygdrive/c/dev/Android/android-ndk-r6/
sources/cxx-stl/stlport/src/ios.cpp: No such file or directory
arm-linux-androideabi-g++.exe: no input files
make: *** [/tmp/ndk-istvanb/tmp/build-6668/build-stlport/armeabi/
ios.o] Error 1
ERROR: Could not build STLport libraries!


With NDKr5c everything was fine as the build script automatically
found and used the prebuilt libs from "android-ndk-r5c\sources\cxx-stl
\stlport\libs".

What's the recommended way to use "STLport" with NDKr6? Am I missing
something?

Thanks,

Istvan

Zoran Angelov

unread,
Aug 23, 2011, 6:11:13 PM8/23/11
to andro...@googlegroups.com
Hi,
I had a similar problem with compiling boost libraries.
The problem was that gcc toolchain does not accept cygwin style paths like /cygdrive/d/Developer/....
Try somehow to force your build-stlport.sh to provide gcc with paths like d:/Developer/...
Maybe with providing --ndk-dir=c:/path_to_ndk_dir?



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


barainvienna

unread,
Aug 24, 2011, 3:13:39 AM8/24/11
to android-ndk
Hi,

Thanks for the tip. I tried setting "--ndk-dir" but then got the
following error:

/tmp/ndk-istvanb/tmp/build-896/build-stlport/Makefile:68: *** target
pattern contains no `%'. Stop.
ERROR: Could not build STLport libraries!

Line #68 in the auto-generated temporary makefile is the following:

all: c:/dev/Android/android-ndk-r6/sources/cxx-stl/stlport/libs/
armeabi/libstlport_static.a

Do you have any ideas? Thanks!


On Aug 24, 12:11 am, Zoran Angelov <bald...@gmail.com> wrote:
> Hi,
> I had a similar problem with compiling boost libraries.
> The problem was that gcc toolchain does not accept cygwin style paths like
> /cygdrive/d/Developer/....
> Try somehow to force your build-stlport.sh to provide gcc with paths like
> d:/Developer/...
> Maybe with providing --ndk-dir=c:/path_to_ndk_dir?
>
> On Tue, Aug 23, 2011 at 11:16 PM, barainvienna
> <istvan.barako...@gmail.com>wrote:

Zoran Angelov

unread,
Aug 24, 2011, 5:45:12 AM8/24/11
to andro...@googlegroups.com
Hi,
after my research i found that windows-like paths in make are broken since make-3.81 under cygwin.
The script for building stlport generates Makefile for stlport and then builds it with make.
Here is modified build-stlport.sh that corrects file paths in generated Makefile.

You do not need to specify --ndk-dir, just run: sh build-stlport.sh

Hope this will help you.
build-stlport.sh

barainvienna

unread,
Aug 26, 2011, 4:59:39 AM8/26/11
to android-ndk
Thanks your help!
Your script worked and built the .so and .a files, however, produced 2
warnings, both of them with the same message.

C:/dev/Android/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/
4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: warning: type and
size of dynamic symbol `__dso_handle' are not defined

Curiously, the binary size of all libraries (.so and .a for both
armeabi and armeabi-v7a) is ~10x less than that of NDKr5c and libs I
get when build my project with STLPORT_FORCE_REBUILD set to true.
I haven't done an analysis yet about what might be missing, so it's
just FYI.

Thanks again for looking into it.



On Aug 24, 11:45 am, Zoran Angelov <bald...@gmail.com> wrote:
> Hi,
> after my research i found that windows-like paths in make are broken since
> make-3.81 under cygwin.
> The script for building stlport generates Makefile for stlport and then
> builds it with make.
> Here is modified build-stlport.sh that corrects file paths in generated
> Makefile.
>
> You do not need to specify --ndk-dir, just run: sh build-stlport.sh
>
> Hope this will help you.
>
>  build-stlport.sh
> 10KViewDownload

Zoran Angelov

unread,
Aug 26, 2011, 6:48:07 AM8/26/11
to andro...@googlegroups.com
I've got those warnings too, i'm not sure if is it ok, but you can test the build and see if everything works ok.

The size of the stl-port libraries in NDKR6 are smaller than in NDKR5C because in NDKR5C the libraries were built with ndk-build that by default specifies -g flag to gcc/g++ (generate debug information), while in NDKR6 stl-port library are built with make and generated Makefile does not specify -g flag to gcc/g++ ( no debug information included in .a and .so ).
Reply all
Reply to author
Forward
0 new messages